package thinkingJava.chapter16;

import java.util.Arrays;

public class AlphabeticSearch {
	public static void main(String[] args) {
		String[] sa = new String[30];
		for (int i = 0; i < sa.length ; i++) {
			sa[i] = new RandomGenerator.String(5).next();
		}
		Arrays.sort(sa, String.CASE_INSENSITIVE_ORDER);
		System.out.println(Arrays.toString(sa));
		int index = Arrays.binarySearch(sa, sa[10], String.CASE_INSENSITIVE_ORDER);
		System.out.println("index : " + index + " value : " + sa[index]);
	}
}
